import worker from '@ohos.worker';

let parent = worker.workerPort;

parent.onmessage = function(message) {
  // 发送消息到主线程
  parent.postMessage(`${message.data} \n message from worker thread.`)
}